|
|
|
|
|
|
|
Using Move to Navigate Recordsets |
|
|
|
|
|
|
|
|
The Move methods offer the most basic form of record searching. There are four methods you can apply to the Recordset object: |
|
|
|
|
|
|
|
|
·MoveFirst: This method moves the record pointer to the first record in the dataset. This method is the same as clicking the double-headed arrow on the left side of the data control. |
|
|
|
|
|
|
|
|
·MovePrevious: This method moves the record pointer to the record just before the current record. This method is the same as clicking the single-headed arrow on the left side of the data control. |
|
|
|
|
|
|
|
|
·MoveNext: This method moves the record pointer to the record just after the current record. This method is the same as clicking the single-headed arrow on the right side of the data control. |
|
|
|
|
|
|
|
|
·MoveLast: This method moves the record pointer directly to the last record in the dataset. This method is the same as clicking the double-headed arrow on the right side of the data control. |
|
|
|
|
|
|
|
|
To practice using these methods, start a new Visual Basic project. Save the form as FRMMOVE.FRM and the project as PRJMOVE.VBP. Table 10.1 contains a list of controls to add to the form. Refer to Figure 10.1 as a guide as you lay out the form. |
|
|
|
|
|
|
|
|
Figure 10.1.
Laying out the frmMove form. |
|
|
|
|
| Table 10.1. Controls for project PRJMOVE.VBP. | | Control | Property | Setting | | VB.Form | Name | frmMove | | Caption | ''MS Jet Move Methods" | | ClientHeight | 1470 | | ClientLeft | 60 | | ClientTop | 345 | | ClientWidth | 5400 |
|
|
|
|
|
|
(table continued on next page) |
|
|
|
|
|